#coding:utf-8
#解析数据
from bs4 import BeautifulSoup
import os
import pymysql as mysql
import string
import requests
import configparser
import re
import math
import time
import io
import sqlite3
import shutil




coverroot = r'E:\down_data\wanli\20180423\cover'#图片目录

if __name__=="__main__":
	sqlList = []
	cnt = 0
	for parent, dirnames, filenames in os.walk(coverroot):
		for filename in filenames:
			if not filename.endswith('.html'):
				continue
			portion = os.path.splitext(filename)
			if portion[1] ==".html":#根据后缀来修改,如无后缀则空
				newname = portion[0]+".jpg"#要改的新后缀
				fileroot = os.path.join(parent,filename)
				jpg = os.path.join(parent,newname)
				os.rename(fileroot,jpg)